package com.kan.awaits.mongo.query.aql;

import com.mongodb.BasicDBObject;
import com.mongodb.DBObject;

/**
 * 集合查询语言
 * 
 * @author Elva
 * @date 2011-4-14
 * @version 1.0
 */
public class AQLParser
{
	public static final String FROM = "FROM";

	public static final String WHERE = "WHERE";

	public static final String AND = "AND";

	public static final String OR = "OR";

	public ParserdAQL parser(String aql)
	{
		// FROM T WHERE id > 0 AND address.id < 120
		// DELETE T WHERE id > 0;

		DBObject query = new BasicDBObject();
		query.put("id", new BasicDBObject("$gt", 0));
		query.put("address.id", new BasicDBObject("$lt", 120));
		return null;
	}

	public static class AQL
	{
		private String aql;

		public AQL(String aql)
		{
			this.aql = aql;
		}
	}

	public static class ParserdAQL
	{
		private String entityName;//

		private DBObject query;// 

		int operator;// 查询，删除，更新。。
	}
}
